/******************************************************************************
 * Product: Adempiere ERP & CRM Smart Business Solution                       *
 * Copyright (C) 1999-2007 ComPiere, Inc. All Rights Reserved.                *
 * This program is free software, you can redistribute it and/or modify it    *
 * under the terms version 2 of the GNU General Public License as published   *
 * by the Free Software Foundation. This program is distributed in the hope   *
 * that it will be useful, but WITHOUT ANY WARRANTY, without even the implied *
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.           *
 * See the GNU General Public License for more details.                       *
 * You should have received a copy of the GNU General Public License along    *
 * with this program, if not, write to the Free Software Foundation, Inc.,    *
 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.                     *
 * For the text or an alternative of this public license, you may reach us    *
 * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA        *
 * or via info@compiere.org or http://www.compiere.org/license.html           *
 *****************************************************************************/
/** Generated Model - DO NOT CHANGE */
package org.compiere.model;

import java.sql.ResultSet;
import java.sql.Timestamp;
import java.util.Properties;

/** Generated Model for hrm_workschedule
 *  @author Adempiere (generated) 
 *  @version Release 3.7.0LTS - $Id$ */
public class X_hrm_workschedule extends PO implements I_hrm_workschedule, I_Persistent 
{

	/**
	 *
	 */
	private static final long serialVersionUID = 20120615L;

    /** Standard Constructor */
    public X_hrm_workschedule (Properties ctx, int hrm_workschedule_ID, String trxName)
    {
      super (ctx, hrm_workschedule_ID, trxName);
      /** if (hrm_workschedule_ID == 0)
        {
			sethrm_datefrom (new Timestamp( System.currentTimeMillis() ));
			sethrm_onedayType_ID (0);
			sethrm_shedulerule_ID (0);
			sethrm_workschedule_ID (0);
			sethrm_workshedulesettings_ID (0);
        } */
    }

    /** Load Constructor */
    public X_hrm_workschedule (Properties ctx, ResultSet rs, String trxName)
    {
      super (ctx, rs, trxName);
    }

    /** AccessLevel
      * @return 3 - Client - Org 
      */
    protected int get_AccessLevel()
    {
      return accessLevel.intValue();
    }

    /** Load Meta Data */
    protected POInfo initPO (Properties ctx)
    {
      POInfo poi = POInfo.getPOInfo (ctx, Table_ID, get_TrxName());
      return poi;
    }

    public String toString()
    {
      StringBuffer sb = new StringBuffer ("X_hrm_workschedule[")
        .append(get_ID()).append("]");
      return sb.toString();
    }

	/** Set date from.
		@param hrm_datefrom date from	  */
	public void sethrm_datefrom (Timestamp hrm_datefrom)
	{
		set_Value (COLUMNNAME_hrm_datefrom, hrm_datefrom);
	}

	/** Get date from.
		@return date from	  */
	public Timestamp gethrm_datefrom () 
	{
		return (Timestamp)get_Value(COLUMNNAME_hrm_datefrom);
	}

	/** Set hrm_dayoff.
		@param hrm_dayoff hrm_dayoff	  */
	public void sethrm_dayoff (boolean hrm_dayoff)
	{
		set_Value (COLUMNNAME_hrm_dayoff, Boolean.valueOf(hrm_dayoff));
	}

	/** Get hrm_dayoff.
		@return hrm_dayoff	  */
	public boolean ishrm_dayoff () 
	{
		Object oo = get_Value(COLUMNNAME_hrm_dayoff);
		if (oo != null) 
		{
			 if (oo instanceof Boolean) 
				 return ((Boolean)oo).booleanValue(); 
			return "Y".equals(oo);
		}
		return false;
	}

	/** Set hrm_holiday.
		@param hrm_holiday hrm_holiday	  */
	public void sethrm_holiday (boolean hrm_holiday)
	{
		set_Value (COLUMNNAME_hrm_holiday, Boolean.valueOf(hrm_holiday));
	}

	/** Get hrm_holiday.
		@return hrm_holiday	  */
	public boolean ishrm_holiday () 
	{
		Object oo = get_Value(COLUMNNAME_hrm_holiday);
		if (oo != null) 
		{
			 if (oo instanceof Boolean) 
				 return ((Boolean)oo).booleanValue(); 
			return "Y".equals(oo);
		}
		return false;
	}

	public I_hrm_holidays gethrm_holidays() throws RuntimeException
    {
		return (I_hrm_holidays)MTable.get(getCtx(), I_hrm_holidays.Table_Name)
			.getPO(gethrm_holidays_ID(), get_TrxName());	}

	/** Set hrm_holidays_ID.
		@param hrm_holidays_ID hrm_holidays_ID	  */
	public void sethrm_holidays_ID (int hrm_holidays_ID)
	{
		if (hrm_holidays_ID < 1) 
			set_Value (COLUMNNAME_hrm_holidays_ID, null);
		else 
			set_Value (COLUMNNAME_hrm_holidays_ID, Integer.valueOf(hrm_holidays_ID));
	}

	/** Get hrm_holidays_ID.
		@return hrm_holidays_ID	  */
	public int gethrm_holidays_ID () 
	{
		Integer ii = (Integer)get_Value(COLUMNNAME_hrm_holidays_ID);
		if (ii == null)
			 return 0;
		return ii.intValue();
	}

	/** Set name day.
		@param hrm_nameday 
		name day
	  */
	public void sethrm_nameday (String hrm_nameday)
	{
		set_Value (COLUMNNAME_hrm_nameday, hrm_nameday);
	}

	/** Get name day.
		@return name day
	  */
	public String gethrm_nameday () 
	{
		return (String)get_Value(COLUMNNAME_hrm_nameday);
	}

	public I_hrm_dayschedule gethrm_onedayType() throws RuntimeException
    {
		return (I_hrm_dayschedule)MTable.get(getCtx(), I_hrm_dayschedule.Table_Name)
			.getPO(gethrm_onedayType_ID(), get_TrxName());	}

	/** Set hrm_onedayType_ID.
		@param hrm_onedayType_ID hrm_onedayType_ID	  */
	public void sethrm_onedayType_ID (int hrm_onedayType_ID)
	{
		if (hrm_onedayType_ID < 1) 
			set_Value (COLUMNNAME_hrm_onedayType_ID, null);
		else 
			set_Value (COLUMNNAME_hrm_onedayType_ID, Integer.valueOf(hrm_onedayType_ID));
	}

	/** Get hrm_onedayType_ID.
		@return hrm_onedayType_ID	  */
	public int gethrm_onedayType_ID () 
	{
		Integer ii = (Integer)get_Value(COLUMNNAME_hrm_onedayType_ID);
		if (ii == null)
			 return 0;
		return ii.intValue();
	}

	public I_hrm_shedulerule gethrm_shedulerule() throws RuntimeException
    {
		return (I_hrm_shedulerule)MTable.get(getCtx(), I_hrm_shedulerule.Table_Name)
			.getPO(gethrm_shedulerule_ID(), get_TrxName());	}

	/** Set hrm_shedulerule.
		@param hrm_shedulerule_ID hrm_shedulerule	  */
	public void sethrm_shedulerule_ID (int hrm_shedulerule_ID)
	{
		if (hrm_shedulerule_ID < 1) 
			set_Value (COLUMNNAME_hrm_shedulerule_ID, null);
		else 
			set_Value (COLUMNNAME_hrm_shedulerule_ID, Integer.valueOf(hrm_shedulerule_ID));
	}

	/** Get hrm_shedulerule.
		@return hrm_shedulerule	  */
	public int gethrm_shedulerule_ID () 
	{
		Integer ii = (Integer)get_Value(COLUMNNAME_hrm_shedulerule_ID);
		if (ii == null)
			 return 0;
		return ii.intValue();
	}

	/** Set hrm_workschedule.
		@param hrm_workschedule_ID hrm_workschedule	  */
	public void sethrm_workschedule_ID (int hrm_workschedule_ID)
	{
		if (hrm_workschedule_ID < 1) 
			set_ValueNoCheck (COLUMNNAME_hrm_workschedule_ID, null);
		else 
			set_ValueNoCheck (COLUMNNAME_hrm_workschedule_ID, Integer.valueOf(hrm_workschedule_ID));
	}

	/** Get hrm_workschedule.
		@return hrm_workschedule	  */
	public int gethrm_workschedule_ID () 
	{
		Integer ii = (Integer)get_Value(COLUMNNAME_hrm_workschedule_ID);
		if (ii == null)
			 return 0;
		return ii.intValue();
	}

	public I_hrm_workshedulesettings gethrm_workshedulesettings() throws RuntimeException
    {
		return (I_hrm_workshedulesettings)MTable.get(getCtx(), I_hrm_workshedulesettings.Table_Name)
			.getPO(gethrm_workshedulesettings_ID(), get_TrxName());	}

	/** Set hrm_workshedulesettings.
		@param hrm_workshedulesettings_ID hrm_workshedulesettings	  */
	public void sethrm_workshedulesettings_ID (int hrm_workshedulesettings_ID)
	{
		if (hrm_workshedulesettings_ID < 1) 
			set_ValueNoCheck (COLUMNNAME_hrm_workshedulesettings_ID, null);
		else 
			set_ValueNoCheck (COLUMNNAME_hrm_workshedulesettings_ID, Integer.valueOf(hrm_workshedulesettings_ID));
	}

	/** Get hrm_workshedulesettings.
		@return hrm_workshedulesettings	  */
	public int gethrm_workshedulesettings_ID () 
	{
		Integer ii = (Integer)get_Value(COLUMNNAME_hrm_workshedulesettings_ID);
		if (ii == null)
			 return 0;
		return ii.intValue();
	}
}